package com.example.q_kang.hhh.home;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.base.BasePresenter;
import com.sskj.base.base.HttpData;
import com.sskj.base.bean.SendListBean;
import com.example.q_kang.hhh.api.JsonConverter;

import java.util.List;

import io.reactivex.Flowable;


/**
 * @author Hey
 * Create at  2019/04/11
 */
class SendRecordPresenter extends BasePresenter<SendRecordActivity> {

    public Flowable<List<SendListBean.SendBean>> getSendJiHuoList(int page) {
        return httpService.getSendJiHuoList(page)
                .tag(this)
                .converter(new JsonConverter<HttpData<SendListBean>>() {
                })
                .adapt(new FlowableBody<>())
                .map(listHttpData -> listHttpData.getData().getList());
    }

    public Flowable<List<SendListBean.SendBean>> getSendPaiDanList(int page) {
        return httpService.getSendPaiDanList(page)
                .tag(this)
                .converter(new JsonConverter<HttpData<SendListBean>>() {
                })
                .adapt(new FlowableBody<>())
                .map(listHttpData -> listHttpData.getData().getList());

    }
}
